﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace UnitTestProject
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            string dtFmt = "20231102";
            string tb = "his_130120231102";
            DateTime dt = DateTime.ParseExact(dtFmt, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture);
            // 2、计算日期所在的季度
            int month = dt.Month;
            int quarter = (month - 1) / 3 + 1;
            string newTB = tb.Substring(0, tb.Length - 4) + quarter;
            Console.WriteLine(newTB);
            Assert.AreEqual("his_130120234", newTB, "不对");
        }
    }
}